//////////////////////////////////////////////////////////////////////////////
//
//  Created by Philip Mulcahy on 07/06/2012.
//  Copyright (c) 2012 Philip Mulcahy. All rights reserved.
//
//  This file is part of the note-recog library.
//
//  note-recog is free software: you can redistribute it and/or modify
//  it under the terms of version 3 of the GNU Lesser General Public License 
//  as published by the Free Software Foundation.
//
//  note-recog is distributed is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with note-recog.  If not, see <http://www.gnu.org/licenses/>.
//
//////////////////////////////////////////////////////////////////////////////

#ifndef note_recog_Rememberer_h
#define note_recog_Rememberer_h


#include <iostream>
#include <map>
#include "IConsumer.h"
#include "Condenser.h"


/// Validating mock IConsumer
class Rememberer : public IConsumer
{
public:
    typedef std::map<double,float> Notes;
    
    Rememberer();
    Rememberer( const Notes& expected );
    
    virtual void onNoteRecognized(const INoteEvent& evt);
    const Notes& getNotes() const;
                
    void playDataViaCondenser( const char * name, 
                               const Condenser::InitInfo& );
    static Notes playDataIntoCondenser( const char * name,  
                                        const Condenser::InitInfo& );
    
    /// Returns error score - zero is a perfect result
    /// more positive is worse
    float validate() const;
    
private:
    LOG_DECLARE;
    Notes _actuals;
    Notes _expecteds;
    
    Rememberer( const Rememberer& ); // not implemented;
    Rememberer& operator=( const Rememberer& ); // not implemented
};

#endif
